<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>拉拉货物流有限公司</title>
		<meta name="keywords" content="拉拉货物流有限公司,汕头物流配送,汕头物流,汕头物流货运,汕头货运,全国货运,厦门物流配送,深圳物流配送,广州物流配送,物流配送,物流货运,货运配送" />
	    <meta name="description" content="拉拉货物流有限公司是一家承接全国各地门到门配送业务的专业第三方物流，为企业量身定做仓储、配送物流方案，针对大小客户配备专业项目小组进行专人专车对接。" />
	    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	    <link rel="stylesheet" href="css/amazeui.min.css" type="text/css" />
	    <link rel="stylesheet" href="css/style.css" type="text/css" />
		<link rel="stylesheet" href="layui/css/layui.css">
	    <script type="text/javascript" src="js/jquery.min.js" ></script>
	    <script type="text/javascript" src="js/amazeui.min.js" ></script>
		<script src="layui/layui.js"></script>
	</head>
	<body class="bgcolor">
		<header data-am-widget="header" class="am-header am-header-default header-white">
	      <div class="am-header-left am-header-nav">
		     <a href="javascript:history.back()" class=""><i class="am-icon-chevron-left"></i></a>
	      </div>
	      <h1 class="am-header-title">用户登录</h1>
	      <div class="am-header-right am-header-nav">
	      	<a href="tel:10086">帮助</a>
	      </div>
        </header>
        <div class="jl"></div>
		<form >
        <input type="text" name="userName" placeholder="请输入用户名" class="login-name mt20">
        <input type="password" name="passWord" placeholder="请输入密码" class="login-name mt20">
        <div class="yzm mt20">
	    	<input type="text" class="reg-yzm" name="safecode" placeholder="输入验证码">
	    	<!--<input type="button" class="yzm-hq" value="获取验证码">-->
			<img src="http://localhost:8081/safecode" onclick="changeCode(this)"/>
	    </div>
	    <input type="button" class="login-btn" value="登录" id="userlogin">
		</form>
	    <p class="login-text">
                          没有账号？点此<a href="reg" class="reg">注册</a>
          <a href="pwdfind.html" class="password">忘记密码</a>
        </p>
	</body>
	<script>
		var url= JSON.parse(sessionStorage.getItem("url"))
		function changeCode(d){
			d.src=url+'/safecode?d='+new Date()*1;
		}
    layui.use(['jquery','layer'],function () {
		var $=layui.jquery;
		var layer=layui.layer;
		//用户登录
      $("#userlogin").click(function () {
           $.ajax({
			   url:url+"/user/login",
			   type:'post',
			   dataType:'json',
			   data:$("form").serialize(),
			   success:function (r) {
                  if (r.code==200){
                  	layer.msg("登录成功",{icon:1,time:1000})
					var user=JSON.stringify(r.data)
					sessionStorage.setItem("user",user)
					location.href="index2.html"
				  } else {
					  layer.msg(r.message,{icon:5,time:1000})
				  }
			   }


		   })


	  })





	})
	</script>
</html>
